YAxisComponent
YAxisComponent API
- YAxisComponent.setExtentIdx
- Parameters
- extentIdx: number
- Returns
- void
YAxisComponent.setExtentIdx(extentIdx: number): void
- YAxisComponent.registerDefaultLabelColorResolvers
- Returns
- void
YAxisComponent.registerDefaultLabelColorResolvers(): void
Registers default label color resolvers for different chart types.
- YAxisComponent.doActivate
- Returns
- void
YAxisComponent.doActivate(): void
This method is used to activate a protected feature. It does not take any arguments and does not return anything.
- YAxisComponent.updateCursor
- Returns
- void
YAxisComponent.updateCursor(): void
- YAxisComponent.updateOrderedLabels
- Parameters
- adjustYAxisWidth: boolean
- Returns
- void
YAxisComponent.updateOrderedLabels(adjustYAxisWidth: boolean): void
Updates labels visual appearance on canvas
- YAxisComponent.registerLabelColorResolver
- Parameters
- chartType: keyof BarTypes
- - The type of chart for which the label color resolver is being registered.
- resolver: LabelColorResolver
- - The function that will be used to resolve the color of the labels for the specified chart type.
- Returns
- void
YAxisComponent.registerLabelColorResolver(chartType: keyof BarTypes, resolver: LabelColorResolver): void
Registers a label color resolver for a specific chart type.
- YAxisComponent.getLabelsColorResolver
- Parameters
- candlesType: string
- - The type of data series.
- Returns
- LabelColorResolver
YAxisComponent.getLabelsColorResolver(candlesType: string): LabelColorResolver
Returns a function that resolves the color for a label based on the type of data series.
- YAxisComponent.registerYAxisLabelsProvider
- Parameters
- provider: YAxisLabelsProvider
- groupName: string
- - a group in which labels position recalculation algorithm will be applied, usually it's subchart name
- id: string
- Returns
- string
YAxisComponent.registerYAxisLabelsProvider(provider: YAxisLabelsProvider, groupName: string, id: string): string
You can add a custom labels provider for additional labels on YAxis (like for drawings, symbol last price, studies, etc..)
- YAxisComponent.addSimpleYAxisLabel
- Parameters
- name: string
- label: VisualYAxisLabel
- Returns
- void
YAxisComponent.addSimpleYAxisLabel(name: string, label: VisualYAxisLabel): void
An easier way to manage custom y-axis labels, than y-axis labels providers. However, overlapping avoidance is not supported
- YAxisComponent.deleteSimpleYAxisLabel
- Parameters
- name: string
- Returns
- void
YAxisComponent.deleteSimpleYAxisLabel(name: string): void
- YAxisComponent.getAxisType
- Returns
- PriceAxisType
YAxisComponent.getAxisType(): PriceAxisType
- YAxisComponent.unregisterYAxisLabelsProvider
- Parameters
- groupName: string
- - The name of the group from which to unregister the provider. Defaults to LabelsGroups.MAIN.
- id: string
- - The ID of the provider to unregister.
- Returns
- string
YAxisComponent.unregisterYAxisLabelsProvider(groupName: string, id: string): string
Unregister a Y axis labels provider from the specified group.
- YAxisComponent.getBounds
- Returns
- Bounds
YAxisComponent.getBounds(): Bounds
- YAxisComponent.registerYAxisWidthContributor
- Parameters
- contributor: YAxisWidthContributor
- Returns
- void
YAxisComponent.registerYAxisWidthContributor(contributor: YAxisWidthContributor): void
If custom pane has y-axis it has to register width contributor to correctly calculate overall y-axis width.
- YAxisComponent.setAxisType
- Parameters
- type: PriceAxisType
- - the type of axis
- Returns
- void
YAxisComponent.setAxisType(type: PriceAxisType): void
Sets the type of axis: percent, regular or logarithmic.
- YAxisComponent.setYAxisAlign
- Parameters
- align: YAxisAlign
- Returns
- void
YAxisComponent.setYAxisAlign(align: YAxisAlign): void
Change YAxis position to left or to right
- YAxisComponent.setVisible
- Parameters
- isVisible: boolean
- Returns
- void
YAxisComponent.setVisible(isVisible: boolean): void
Controls visibility of the y-axis (additionally disable/enable component)
- YAxisComponent.isVisible
- Returns
- boolean
YAxisComponent.isVisible(): boolean
If visible, when you can see the y-axis on the chart
- YAxisComponent.setLockPriceToBarRatio
- Parameters
- value: boolean
- Returns
- void
YAxisComponent.setLockPriceToBarRatio(value: boolean): void
Controls lockPriceToBarRatio of the y-axis
- YAxisComponent.changeLabelMode
- Parameters
- type: string
- - label type
- mode: YAxisLabelMode
- - visual mode
- Returns
- void
YAxisComponent.changeLabelMode(type: string, mode: YAxisLabelMode): void
Changes the visual type of particular label.
- YAxisComponent.changeLabelAppearance
- Parameters
- type: string
- - label type
- mode: YAxisLabelAppearanceType
- - visual mode
- Returns
- void
YAxisComponent.changeLabelAppearance(type: string, mode: YAxisLabelAppearanceType): void
Changes the visual type of particular label.
- YAxisComponent.togglePriceScaleInverse
- Parameters
- inverse: boolean
- - true or false
- Returns
- void
YAxisComponent.togglePriceScaleInverse(inverse: boolean): void
Sets the inverse price scale mode. Inverts Y axis vertically. Inversion also works for candles, drawings and overlay studies.
- YAxisComponent.changeLabelsDescriptionVisibility
- Parameters
- descVisibility: boolean
- - A boolean value indicating whether the descriptions should be visible or not.
- Returns
- void
YAxisComponent.changeLabelsDescriptionVisibility(descVisibility: boolean): void
Changes the visibility of the labels' descriptions.